ECE 5725 Final Project: RPi Autonomous Guitar Tuner

Cynthia Zelga (cnz5) & Sizhe Zhang (sz592)
December 13, 2019
« Introduction Design & Testing Results Conclusions Future Work Budget References Code Appendix »

Results

By our project demo date, we were able to meet the design goals we set for ourselves. Our finished system can successfully automate turning the tuning pegs on a guitar until the given string is in-tune. The user can choose which string they would like to tune by simply touching one of the six colorful buttons labeled with the scientific pitch notation for each string. Once a string has been selected, the device begins listening for new sounds immediately and the messages displayed on the piTFT give the user clear directions on how to proceed with tuning the given string. The user is periodically told to strum the string after every new strum is detected and the servo motor adjusts the tuning peg. The interface features a colored circle drawn in the center of the screen which is labeled with the target frequency of the string, as well as a lighter colored circle of the same color which is drawn after the frequency of a strum has been detected. If the frequency detected is lower than the target, this circle is drawn to the left of the target frequency circle, whereas if the frequency is higher than the target, the circle is drawn to the right of the target frequency circle. The offset distance of the current frequency circle relative to the target frequency circle is proportionate to the frequency difference between the two frequency values. The closer the string is to being in-tune, the closer the current frequency circle is drawn to the center circle. The difference in frequency values - the magnitude of the difference and whether the difference is positive or negative - determines how the servo motor rotates the tuning peg. We programmed our system so that it only anticipates frequency values that are lower than the target frequency, as this means we are tightening an initially loose guitar string as we progressively increase its frequency to match the target. This was done to reduce the chance of snapping the guitar string as a guitar string can only be tightened to a certain limit higher than its state when in-tune before it will break. This means that prior to using the RPi autonomous tuner, the tuning pegs for all strings should be rotated a bit counterclockwise to lower their frequencies. During tuning, for differences in frequency greater than 20 Hz, we turn the tuning peg by half of a full rotation, and once the difference reduces to less than 20 Hz, the amount of rotation is set by a ratio proportionate to the difference in frequencies. The closer the current frequency is to the target, the less the servo will be turned. Our system detects a tuned string with a tolerance of -2 Hz (again, since we only read current frequencies that are lower than the target). Once the string is correctly tuned, the system displays a message to notify the user that tuning is complete for 4 seconds, before returning to the initial screen where the user can choose the next string to tune. Users can touch the back button on the screen while tuning is in progress to return back to the string selection screen at any time. A quit button to quit the program is also present on the screen, both during tuning as well as on the string selection screen, in addition to a physical quit button connected to the GPIO17 pin adjacent to the piTFT screen. Overall, our team was proud of our work and was happy with the results of our final project.